//Design By Do Trung --- Email : trungqn19852003@yahoo.com
//Ngày Design :5/6/2011 9:55:25 AM
using System;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Linq;
using System.Collections.Generic;
	/// <summary>
	/// </summary>
	public class QuangCao_BA
	{
		public QuangCao_BA() {}
#region 'Variables And Properties'
		 private int int_IdQuangCao ;
		 public int IdQuangCao
			{
			 get 	
				{
					 return this.int_IdQuangCao;
				}
			 set 	
				{
					int_IdQuangCao=value;
				}
			}
		 private int int_IdViTriHienthi ;
		 public int IdViTriHienthi
			{
			 get 	
				{
					 return this.int_IdViTriHienthi;
				}
			 set 	
				{
					int_IdViTriHienthi=value;
				}
			}
		 private string string_TenQuangCao ;
		 public string TenQuangCao
			{
			 get 	
				{
					 return this.string_TenQuangCao;
				}
			 set 	
				{
					string_TenQuangCao=value;
				}
			}
		 private string string_HinhAnh ;
		 public string HinhAnh
			{
			 get 	
				{
					 return this.string_HinhAnh;
				}
			 set 	
				{
					string_HinhAnh=value;
				}
			}
		 private string string_LienKet ;
		 public string LienKet
			{
			 get 	
				{
					 return this.string_LienKet;
				}
			 set 	
				{
					string_LienKet=value;
				}
			}
		 private string string_NgayUpload ;
		 public string NgayUpload
			{
			 get 	
				{
					 return this.string_NgayUpload;
				}
			 set 	
				{
					string_NgayUpload=value;
				}
			}
		 private bool bool_TrangThai ;
		 public bool TrangThai
			{
			 get 	
				{
					 return this.bool_TrangThai;
				}
			 set 	
				{
					bool_TrangThai=value;
				}
			}
#endregion

		/// <summary>
		/// Inserts a record into the QuangCao table.
		/// <summary>
		/// <param name="IdQuangCao"></param>
		/// <param name="IdViTriHienthi"></param>
		/// <param name="TenQuangCao"></param>
		/// <param name="HinhAnh"></param>
		/// <param name="LienKet"></param>
		/// <param name="NgayUpload"></param>
		/// <param name="TrangThai"></param>
		/// <returns></returns>
		public bool Insert(SqlConnection SqlCnn)
		{
			bool boolInsert = false ;
			QuangCao_DA clsDA_QuangCao = new QuangCao_DA();
			clsDA_QuangCao.IdQuangCao=int_IdQuangCao;
			clsDA_QuangCao.IdViTriHienthi=int_IdViTriHienthi;
			clsDA_QuangCao.TenQuangCao=string_TenQuangCao;
			clsDA_QuangCao.HinhAnh=string_HinhAnh;
			clsDA_QuangCao.LienKet=string_LienKet;
			clsDA_QuangCao.NgayUpload=string_NgayUpload;
			clsDA_QuangCao.TrangThai=bool_TrangThai;

			boolInsert = clsDA_QuangCao.Insert(SqlCnn);
			clsDA_QuangCao = null ;
			return boolInsert;
		}

		/// <summary>
		/// Selects a single record from the QuangCao table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable Select(SqlConnection SqlCnn)
		{
			QuangCao_DA clsDA_QuangCao = new QuangCao_DA();
			DataTable dt = new DataTable();
			dt=clsDA_QuangCao.Select(SqlCnn);
			clsDA_QuangCao= null ;
			return dt;
		}

		/// <summary>
		/// Selects a single record from the QuangCao table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable SelectPrimaryKey(SqlConnection SqlCnn)
		{
			QuangCao_DA clsDA_QuangCao = new QuangCao_DA();
			DataTable dt = new DataTable();
			clsDA_QuangCao.IdQuangCao=int_IdQuangCao;

			dt=clsDA_QuangCao.SelectPrimaryKey(SqlCnn);
			clsDA_QuangCao= null;
			return dt;
			}

		/// <summary>
		/// Updates a record in the QuangCao table.
		/// <summary>
		/// <param name="IdQuangCao"></param>
		/// <param name="IdViTriHienthi"></param>
		/// <param name="TenQuangCao"></param>
		/// <param name="HinhAnh"></param>
		/// <param name="LienKet"></param>
		/// <param name="NgayUpload"></param>
		/// <param name="TrangThai"></param>
		public bool Update(SqlConnection SqlCnn)
		{
			bool boolUpdate = false ;
			QuangCao_DA clsDA_QuangCao = new QuangCao_DA();
			clsDA_QuangCao.IdQuangCao=int_IdQuangCao;
			clsDA_QuangCao.IdViTriHienthi=int_IdViTriHienthi;
			clsDA_QuangCao.TenQuangCao=string_TenQuangCao;
			clsDA_QuangCao.HinhAnh=string_HinhAnh;
			clsDA_QuangCao.LienKet=string_LienKet;
			clsDA_QuangCao.NgayUpload=string_NgayUpload;
			clsDA_QuangCao.TrangThai=bool_TrangThai;

			boolUpdate = clsDA_QuangCao.Update(SqlCnn);
			clsDA_QuangCao = null ;
			return boolUpdate;
		}

		/// <summary>
		/// Deletes a record from the QuangCao table by a composite primary key.
		/// <summary>
		public bool Delete(SqlConnection SqlCnn)
		{
			bool boolDelete = false ;
			QuangCao_DA clsDA_QuangCao = new QuangCao_DA();
			clsDA_QuangCao.IdQuangCao=int_IdQuangCao;

			boolDelete = clsDA_QuangCao.Delete(SqlCnn);
			clsDA_QuangCao = null ;
			return boolDelete;
		}
	}
